import { createRouter, createWebHistory } from 'vue-router'
import NProgress from "@/utils/progress";
import routes from "./routes";
import { useTitle } from '@vueuse/core'


const router = createRouter({
  history: createWebHistory(import.meta.env.VITE_BASE_URL),
  routes
})



router.beforeEach((to, from, next) => {
  NProgress.start();
  next();
  // useTitle(to.meta.title || pageDefaultTitle)
});

router.afterEach(() => {
  NProgress.done();
});

export default router
